airvelocity2 2.2.1
Loading...
Searching...
No Matches
airvelocity2


Air Velocity 2 Click

Air Velocity 2 Click demo application is developed using the NECTO Studio, ensuring compatibility with mikroSDK's open-source libraries and tools. Designed for plug-and-play implementation and testing, the demo is fully compatible with all development, starter, and mikromedia boards featuring a mikroBUS™ socket.


Click Library

  • Author : Stefan Filipovic
  • Date : Feb 2025.
  • Type : I2C type

Software Support

Example Description

This example demonstrates the use of Air Velocity 2 Click board by reading and displaying the output counts and air velocity in m/sec.

Example Libraries

  • MikroSDK.Board
  • MikroSDK.Log
  • Click.AirVelocity2

Example Key Functions

Application Init

Initializes the driver and logger.

void application_init ( void )
{
log_cfg_t log_cfg;
airvelocity2_cfg_t airvelocity2_cfg;
LOG_MAP_USB_UART( log_cfg );
log_init( &logger, &log_cfg );
log_info( &logger, " Application Init " );
// Click initialization.
airvelocity2_cfg_setup( &airvelocity2_cfg );
if ( I2C_MASTER_ERROR == airvelocity2_init( &airvelocity2, &airvelocity2_cfg ) )
{
log_error( &logger, " Communication init." );
for ( ; ; );
}
log_info( &logger, " Application Task " );
}
#define AIRVELOCITY2_MAP_MIKROBUS(cfg, mikrobus)
MikroBUS pin mapping.
Definition airvelocity2.h:92
void application_init(void)
Definition main.c:33
#define MIKROBUS_POSITION_AIRVELOCITY2
Definition main.c:27

Application Task

Reads the output counts and converts it to air velocity in m/sec. Both values will be displayed on the USB UART approximately every 125ms.

void application_task ( void )
{
uint16_t out_counts = 0;
if ( AIRVELOCITY2_OK == airvelocity2_read_output ( &airvelocity2, &out_counts ) )
{
log_printf ( &logger, " Out counts: %u\r\n", out_counts );
log_printf ( &logger, " Air velocity: %.2f m/s\r\n\n", airvelocity2_counts_to_mps ( out_counts ) );
Delay_ms ( 125 );
}
}
@ AIRVELOCITY2_OK
Definition airvelocity2.h:133
void application_task(void)
Definition main.c:63

Application Output

This Click board can be interfaced and monitored in two ways:

  • Application Output - Use the "Application Output" window in Debug mode for real-time data monitoring. Set it up properly by following this tutorial.
  • UART Terminal - Monitor data via the UART Terminal using a USB to UART converter. For detailed instructions, check out this tutorial.

Additional Notes and Information

The complete application code and a ready-to-use project are available through the NECTO Studio Package Manager for direct installation in the NECTO Studio. The application code can also be found on the MIKROE GitHub account.